﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WL_Store.DAL;
using WL_Store.Model;

namespace WL_Store.BLL
{
   public class LoginLogsBLL
    {
        LoginLogsDAL dal = new LoginLogsDAL();

        /// <summary>
        /// 查询所有登录日志
        /// </summary>
        /// <returns></returns>
        public List<LoginLogsModel> GetLoginLogs()
        {
            return dal.GetLoginLogs();

        }

        /// <summary>
        /// 添加登录日志
        /// </summary>
        /// <returns></returns>
        public bool AddLonginLog(LoginLogsModel model)
        {
            return dal.AddLonginLog(model);
        }

        /// <summary>
        /// 根据登录名查询，查询姓名
        /// </summary>
        /// <param name="loginName"></param>
        /// <returns></returns>
        public object GetName(string loginName)
        {
            return dal.GetName(loginName);
        }

        /// <summary>
        /// 将用户的退出时间保存在日志中
        /// </summary>
        /// <param name="logId"></param>
        /// <param name="exitTime"></param>
        /// <returns></returns>
        public bool UpdateExitTime(int logId, DateTime exitTime)
        {
            return dal.UpdateExitTime(logId,exitTime);
        }

        /// <summary>
        /// 获取日志自增LogId的当前值
        /// </summary>
        /// <returns></returns>
        public object GetIdentity()
        {
            return dal.GetIdentity();
        }
    }
}
